<!DOCTYPE html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="https://cdn.bootcss.com/angular.js/1.6.3/angular.min.js"></script>
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	 <style>
	 	body{
			font-size:12px;
		}
	 	table,
		th,
		td {
			border: 1px solid grey;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}		
		table td:nth-child(even) {
			
		}
		table tr:nth-child(2) {
			background-color:#f1f1f1;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	 </style>
	<body ng-app="myApp" ng-controller="customersCtrl">
		<div class="">
			<div id="sho"></div>
		<!--更新用户账户信息-->
			<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">
				
				<tbody>
					<tr style="font-size:26px;color:#337ab7">
						<th colspan="12">全平台交易明细：</th>
					</tr>
					<tr>
						<td colspan="12">
							手机号：<input class="form-control" style="width:150px;display:inline-block" type="text" name="" id="" ng-model="ph" value="" /><button ng-click="shouji()" class="btn btn-default" style="margin-left:2px;">查询</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="error" style="color:red"></span>
							身份证：<input type="text" v-model="idcade" class="form-control" style="width:180px;display:inline-block;margin-right:0px;">
							      <button id="code" v-on:click="shen()" class="btn btn-default" style="margin-right:0px;">查询</button>
							审核状态：<select name="" id="sel" v-on:change="xuan()" class="form-control" style="width:120px;display:inline-block;margin-right:10px;">
								<option value="">请选择</option>
							    <option value="0">未审核</option>
								<option value="1">审核通过</option>
								<option value="2">审核失败</option>
							    <option value="3">未提交</option>
							</select>
							 	开始日期：<input type="date" v-model="star" class="form-control" style="width:150px;display:inline-block">
								结束日期：<input type="date" v-model="end" class="form-control" style="width:150px;display:inline-block">
										<button v-on:click="date()" id="date" class="btn btn-default" style="margin-left:20px;">查询</button>
						</td>
					</tr>
					<tr>
						<td colspan="12">
							商户号：
							<input class="form-control" style="width:200px;display:inline-block;margin-right:20px;" type="text">
							<button class="btn btn-default" style="margin-right:20px;" v-on:click="">查询</button>
							银行卡号：
							<input class="form-control" v-model="card" style="width:200px;display:inline-block;margin-right:20px;" type="text">
							<button class="btn btn-default" style="margin-right:20px;" v-on:click="cardno()">查询</button>
							代理等级:
							<select name="" id="s" v-on:change="ji()" class="form-control" style="width:120px;display:inline-block;margin-right:20px;">
							<option value="">请选择</option>
							<option value="0">消费者</option>
							<option value="1">分销商</option>
							<option value="2">代理商</option>
							<option value="3">服务商</option>
						</select>
						</td>
					</tr>
					<tr style="font-size:15px;">
						<td style="width:45px;" class="text-center">序号</td>
						<td class="text-center">通道</td>
						<td class="text-center">品牌ID</td>
						<td class="text-center">总金额</td>
						<td class="text-center">实际金额</td>
						<td class="text-center">额外费用</td>
						<td class="text-center">刷卡费率</td>
						<td class="text-center">手机号</td>
						<td class="text-center">描述</td>
						<td class="text-center">类型</td>
						<td class="text-center">状态</td>
						<td class="text-center">结束时间</td>
					</tr>
					<tr id="show" ng-repeat="item in items">
						<td class="text-center">{{$index+1}}</td>
						<td class="text-center">{{item.channelname}}</td>
						<td class="text-center">{{item.brandid | modify3:item.brandid}}</td>
						<td class="text-center">{{item.amount | currency:"￥ "}}</td>
						<td class="text-center">{{item.realAmount | currency:"￥ "}}</td>
						<td class="text-center">{{item.extraFee | currency:"￥ "}}</td>						
						<td class="text-center">{{item.rate}}</td>
						<td class="text-center">{{item.phone}}</td>
						<td class="text-center">{{item.desc}}</td>
						<td class="text-center">{{item.type | modify:item.type}}</td>
						<td class="text-center">{{item.status | modify2:item.status}}</td>
						<td class="text-center">{{item.createTime}}</td>
					</tr>
					<tr>
						<td colspan="12" id="show01" class="text-center">
							第<input class="form-control" id="ye" ng-init="ye=1" ng-model="ye" style="width:50px;display:inline-block" type="text"/>页
							<button class="btn btn-default" ng-click="xia()">跳转</button>总共{{pages}}条数据    当前一共{{page}}页
							<button class="btn btn-default" ng-click="home()">首页</button>
							<button class="btn btn-default" ng-click="sh()">上一页</button>
							<button class="btn btn-default" ng-click="next()">下一页</button>
							<button class="btn btn-default" ng-click="last(page)">尾页</button>
						</td>
					</tr>
				</tbody>
			</table>		
		</div>
		</div>
	</body>
	<script>
		$(function(){		
		})
	</script>
	<script>
		var app = angular.module('myApp', []);
		
		app.filter('modify0',function(){
					return function(input,param){
						if(param == "WEIXIN_QRCODE"){
							return param = "微信支付"
						}
						if(param == "ALIPAY_QRCODE"){
							return param = "支付宝支付"
						}
						if(param == "YILIAN"){
							return param = "易联支付"
						}
						if(param == "ZHONGMAO_PAY"){
							return param = "中茂支付"
						}
						if(param == "JIEFUBAO"){
							return param = "京东钱包"
						}
						if(param == "SWIFT_QQ_QRCODE"){
							return param = "qq扫码"
						}
						if(param == "SWIFT_ALIPAY_QRCODE"){
							return param = "支付宝扫码"
						}
						if(param == "SWIFT_WEIXIN_QRCODE"){
							return param = "微信扫码支付"
						}
					}
				})
	   /*自定义过滤器   1*/
		app.filter("modify",function(){
			return function(input,param){
				if(param == 0){
					return param = "充值"
				}
				if(param == 1){
					return param = "支付"
				}
				if(param == 2){
					return param = "提现"
				}
				if(param == 3){
					return param = "退单"
				}
				input = param
				return input
			}
		})
		/*自定义过滤器   2*/
		app.filter("modify2",function(){
			return function(input,param){
				if(param == 0){
					return param = "待完成"
				}
				if(param == 1){
					return param = "已成功"
				}
				if(param == 2){
					return param = "已取消"
				}
				if(param == 3){
					return param = "待处理"
				}
				if(param == 4){
					return param = "待结算"
				}
				input = param
				return input
			}
		})
		/*过滤器*/
		app.filter("modify3",function(){
			return function(input,param){				
				if(param == 1){
					return param = "赚道钱包"
				}
				if(param == 2){
					return param = "节付宝"
				}
				if(param == 3){
					return param = "闪付"
				}
				if(param == 4){
					return param = "星星钱包"
				}
				if(param == 5){
					return param = "联码钱包"
				}
				if(param == 6){
					return param = "卓顶钱包"
				}
				if(param == 7){
					return param = "谷收钱包"
				}
				if(param == 8){
					return param = "呗付宝"
				}
				if(param == 9){
					return param = "糖果云"
				}
				if(param == 10){
					return param = "卡豚钱包"
				}
				if(param == 11){
					return param = "德发钱包"
				}
				if(param == 12){
					return param = "牛付"
				}
				if(param == 13){
					return param = "点佰趣"
				}				
				if(param == 14){
					return param = "皇城钱包"
				}
				if(param == 15){
					return param = "久久付"
				}
				if(param == 16){
					return param = "趣刷钱包"
				}
				if(param == 17){
					return param = "鑫银付"
				}
				if(param == 18){
					return param = "赚付宝"
				}
				if(param == 19){
					return param = "卡掌柜"
				}
				if(param == 20){
					return param = "情商支付"
				}
				if(param == 21){
					return param = "码上刷"
				}
				if(param == 22){
					return param = "北快支付"
				}
				if(param == 23){
					return param = "便付通"
				}
				/*if(param == 24){
					return param = "赚道钱包"
				}*/

				input = param
				return input
			}
		})
        app.controller('customersCtrl', function($scope, $http ){
        	/*根据登陆信息获取token*/
        	var token = sessionStorage.getItem(key=1);
        	var brandid = sessionStorage.getItem(key=3);
        	console.log(token)
        	/*直接或分页查询交易明细*/
				$http({
					method:'POST',
					params:{size:10,page:0},					
					url: window.baseUrl+"transactionclear/payment/query/all"					
				}).then(function successCallback(data){
					console.log("直接或分页查询交易明细成功...")
					console.log(data.data)
					$scope.items = data.data.result.content
					$scope.pages = data.data.result.totalElements
					$scope.page  = data.data.result.totalPages
					/*$scope.size = */
				}, function errorCallback(data) {
						console.log("直接或分页查询交易明细失败...")
				     	console.log(data)
				});
				$scope.xia = function(){
					var brandid = sessionStorage.getItem(key=3);
					var ye = document.getElementById("ye").value-1;
					$http({
					method:'POST',
					params:{size:10,page:ye},					
					url: window.baseUrl+"transactionclear/payment/query/all"					
					}).then(function successCallback(data){
						console.log("直接或分页查询交易明细成功...")
						console.log(data.data)
						$scope.items = data.data.result.content
						$scope.pages = data.data.result.totalElements
						$scope.page  = data.data.result.totalPages
					}, function errorCallback(data) {
							console.log("直接或分页查询交易明细失败...")
					     	console.log(data)
					});
				}
				/*回到首页*/
				$scope.home = function(){
					var brandid = sessionStorage.getItem(key=3);
					$scope.ye = 1;
                    $http({
                        method:'POST',
                        params:{size:10,page:$scope.ye-1},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });
				}
				/*到达最后一页*/
				$scope.last = function(page){
					var brandid = sessionStorage.getItem(key=3);
				    console.log(page);
                    $http({
                        method:'POST',
                        params:{size:10,page:page-1},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });
                    $scope.ye = page
				}
				/*下一页*/
				$scope.next = function(){
					var brandid = sessionStorage.getItem(key=3);
				   	var ye =  $scope.ye+=1;
				   console.log(ye-1)
                    $http({
                        method:'POST',
                        params:{size:10,page:ye-1},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });
				}
				/*上一页*/
				$scope.sh = function(){
					var brandid = sessionStorage.getItem(key=3);
				    var ye = $scope.ye-=1;
				    console.log(ye);
				    if(ye <= 0){
				        $scope.ye = 1;
				        console.log(ye)
					}
                    $http({
                        method:'POST',
                        params:{size:10,page:ye},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });

				}
				/*手机号码查询*/
				$scope.shouji = function(){

					var brandid = sessionStorage.getItem(key=3);
					var phone = $scope.ph;
					console.log(phone)
					 $http({
                        method:'POST',
                        params:{phone:phone},
                        url: window.baseUrl+"transactionclear/payment/query/all"
                    }).then(function successCallback(data){
                        console.log("直接或分页查询交易明细成功...")
                        console.log(data.data)
                        $scope.items = data.data.result.content
                        $scope.pages = data.data.result.totalElements
                        $scope.page  = data.data.result.totalPages
                    }, function errorCallback(data) {
                        console.log("直接或分页查询交易明细失败...")
                        console.log(data)
                    });
				}
        })
	</script>
</html>

